package cardwall.client.controller;

import org.puremvc.java.multicore.patterns.command.SimpleCommand;
import org.puremvc.java.multicore.interfaces.INotification;
import cardwall.client.ApplicationFacade;
import cardwall.client.CardWall;
import cardwall.client.model.TasksProxy;
import cardwall.client.view.ApplicationMediator;

/**
 * @author $LastChangedBy: vogensen $
 * @version $Revision: 2 $
 */
public class StartupCommand extends SimpleCommand {
    public void execute(INotification iNotification) {
        ApplicationFacade.getInstance().registerProxy(new TasksProxy());
        ApplicationFacade.getInstance().registerMediator(new ApplicationMediator((CardWall)iNotification.getBody()));

        TasksProxy tasksProxy = (TasksProxy) ApplicationFacade.getInstance().retrieveProxy(TasksProxy.PROXYNAME);
        tasksProxy.refreshTasks();
    }
}
